function setCookie(name,value,mins) {//存cookie
    var date=new Date();
    date.setTime(date.getTime()+mins*1000*60);
    // date.setMinutes(date.getMinutes()+mins)
    //toUTCString(转化成国际时间) 因为cookies默认是国际时间
    document.cookie=name+"="+value+";expires="+date.toUTCString();
}
function getCookie(name){//取cookies函数
    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
    if(arr != null) return (arr[2]); return null;
}
function delCookie(name) {
    setCookie(name,"",0);
}
function exit(){//删除cookie
    setCookie("user",getCookie(name),0);
    location.href="index.html";
}